/*
 * FileName:    ColumnTag.java
 * Description:  グリッドタグ
 * History:      2010-9-16 (廖宝俊) 1.0 Create
 */
package com.sn.system.tangs.tag;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class ColumnTag extends ComponentTagSupport{

	/** 列値の名 */
	private String property;
	/** 列名 */
	private String title;

	/** リンクＵＲＬ */
	private String href;

	/** リンクパラメータの名 */
	private String paramId;

	/** リンクパラメータの列値の名 */
	private String paramProperty;

	/** 列のタイプ */
	private String type;

	/** radio、checkBoxの名 */
	private String name;

	/** radio、checkBoxの列値の名 */
	private String value;

	/** 列値フォーマット */
	private String format;


    /** CSSのClass */
    private String cssClass;

    /** 列幅 */
    private String width;

    /** 列のalign */
    private String align;

	public void setCssClass(String cssClass) {
		this.cssClass = cssClass;
	}

	public void setWidth(String width) {
		this.width = width;
	}

	public void setAlign(String align) {
		this.align = align;
	}

	public void setFormat(String format) {
		this.format = format;
	}

	public void setHref(String href) {
		this.href = href;
	}

	public void setParamId(String paramId) {
		this.paramId = paramId;
	}

	public void setParamProperty(String paramProperty) {
		this.paramProperty = paramProperty;
	}

	public void setType(String type) {
		this.type = type;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public void setProperty(String property) {
		this.property = property;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Override
	public Component getBean(ValueStack arg0, HttpServletRequest arg1,
			HttpServletResponse arg2) {
		return new Column(arg0);
	}

	/**
     * パラメータを取りする
     */
    protected void populateParams() {
        super.populateParams();
        Column col = (Column)component;
        col.setProperty(property);
        col.setTitle(title);
        col.setHref(href);
        col.setName(name);
        col.setParamId(paramId);
        col.setParamProperty(paramProperty);
        col.setType(type);
        col.setValue(value);
        col.setFormat(format);

        col.setAlign(align);
        col.setCssClass(cssClass);
        col.setWidth(width);

    }
}
